// JavaScript Document
function rankGrade()
{
	var LEVEL1 = 300;
	var LEVEL2 = 2400;
	var LEVEL3 = 4800;
	var LEVEL4 = 12000;
	var LEVEL5 = 40000;
	var LEVEL6 = 300000;
	var LEVEL7 = 1000000;
	
	var level = document.getElementById("Ievel").innerHTML;
	var grade = document.getElementById("Grade");
	var des = document.getElementById("designation");
	var degree = document.getElementById("Degree");
	var imgWidth = document.getElementById("imgWidth");
	
	if(level<LEVEL1){
		grade.innerHTML = LEVEL1;
		des.innerHTML = "牙牙兔";
		degree.innerHTML = "1";
		imgWidth.style.width = parseInt((level/LEVEL1)*100)+'%';
	}
	else if(level>=LEVEL1 && level<LEVEL2){
		grade.innerHTML = LEVEL2;
		des.innerHTML = "小兔丁";
		degree.innerHTML = "2";
		imgWidth.style.width = parseInt((level/LEVEL2)*100)+'%';
		
	}
	else if(level>=LEVEL2 && level<LEVEL3){
		grade.innerHTML = LEVEL3;
		des.innerHTML = "初出兔窟";
		degree.innerHTML = "3";
		imgWidth.style.width = parseInt((level/LEVEL3)*100)+'%';
	}
	else if(level>=LEVEL3 && level<LEVEL4){
		grade.innerHTML = LEVEL4;
		des.innerHTML = "江湖兔侠";
		degree.innerHTML = "4";
		imgWidth.style.width = parseInt((level/LEVEL4)*100)+'%';
	}
	else if(level>=LEVEL4 && level<LEVEL5){
		grade.innerHTML = LEVEL5;
		des.innerHTML = "一代宗兔";
		degree.innerHTML = "5";
		imgWidth.style.width = parseInt((level/LEVEL5)*100)+'%';
	}
	else if(level>=LEVEL5 && level<LEVEL6){
		grade.innerHTML = LEVEL6;
		des.innerHTML = "天兔合一";
		degree.innerHTML = "6";
		imgWidth.style.width = parseInt((level/LEVEL6)*100)+'%';
	}
	else if(level>=LEVEL6 && level<LEVEL7){
		grade.innerHTML = LEVEL7;
		des.innerHTML = "孤兔求败";
		degree.innerHTML = "7";
		imgWidth.style.width = parseInt((level/LEVEL7)*100)+'%';
	}
}
window.onload =function(){rankGrade();}  